<template>
	<view class="content">
		<view class="list" @click="becomeAConcubine" v-if="!is_monthmom">
			<text class="text">成为月嫂</text>
			<text class="text1">></text>
		</view>
		<view class="list" v-else>
			<text class="text">成为月嫂</text>
			<text class="verified">已认证</text>
			<text class="text1">></text>
		</view>
		<view class="list" @click="becomeAConcubine1" v-if="!is_channel">
			<text class="text">成为渠道</text>
			<text class="text1">></text>
		</view>
		<view class="list" v-else>
			<text class="text">成为渠道</text>
			<text class="verified">已认证</text>
			<text class="text1">></text>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			is_monthmom: '',
			is_channel: ''
		};
	},
	onLoad() {
		this.personalCtr();
	},

	methods: {
		//个人中心（用户基础数据）
		async personalCtr() {
			const res = await this.$u.post(
				'/api/User/userinfo',
				{},
				{
					'XX-Token': uni.getStorageSync('token'),
					'XX-Device-Type': 'wxapp'
				}
			);
			console.log('用户基础数据 >>  ', res);
			//this.data = res.data;
			this.is_monthmom = res.data.is_monthmom; // 月嫂
			this.is_channel = res.data.is_channel; // 渠道
		},
		// 成为月嫂
		becomeAConcubine() {
			uni.navigateTo({
				url: '../chengwei/chengwei?id=' + 2
			});
		},
		//认证渠道
		becomeAConcubine1() {
			uni.navigateTo({
				url: '../chengwei2/chengwei?id=' + 3
			});
		}
	}
};
</script>

<style lang="scss">
.content {
	.list {
		position: relative;
		.verified {
			position: absolute;
			right: 50rpx;
			top: 50%;
			transform: translateY(-50%);
			
		}
		width: 690rpx;
		height: 90rpx;
		line-height: 90rpx;
		margin: 20rpx auto;

		background: #ffffff;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 22rpx;
		margin-bottom: 20rpx;

		.text {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
		}
		.text1 {
			color: #c0c0c0;
		}
	}
}
</style>
